package simple10;
//组合模式
public class Simple {
    public static void main(String[] args) {
//        根目录
        DistrictNode root = new DistrictNode("根");

//        一级目录
        root.addChild(new DistrictNode("天津"));
        root.addChild(new DistrictNode("上海"));

        DistrictNode districtNode = new DistrictNode("北京");
        root.addChild(districtNode);

//        二级目录

        districtNode.addChild(new DistrictNode("海淀区"));
        districtNode.addChild(new DistrictNode("西成区"));

        DistrictNode districtNode1 = new DistrictNode("朝阳区");
        districtNode.addChild(districtNode1);

//        三级目录

        districtNode1.addChild(new DistrictNode("三里屯"));
        districtNode1.addChild(new DistrictNode("朝阳外街"));

        System.out.println(root.toString());

        System.out.println("本次快递目的地:北京-朝阳-三里屯");
    }

    public void doOther(){
        System.out.println("其它服务");
    }
}
